package cc.linker.steplink.crm.dao;

import cc.linker.steplink.crm.domain.CustomerBindRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CustomerBindDao {
    Integer insertCustomerBindRelation(CustomerBindRelation relation);

    CustomerBindRelation findBindRelationByCustomerId(@Param("customerId") String customerId);
    
    CustomerBindRelation findBindRelationByGlobalOpenid(@Param("globalOpenid") String globalOpenid);

    CustomerBindRelation findBindRelationByOpenidAndToken(@Param("openid") String openid, @Param("token") String token);

    void updateBindRelation(CustomerBindRelation bindRelation);

    void deleteBindRelation(String customerId);

    List<CustomerBindRelation> findBindRelations();

    void updateBindRelationAndCreateTime(@Param("customerId") String customerId, @Param("staffType") Integer staffType);

    String getOrgIdFromWeixinList(String token);

    Map getOpenIdAndToken(@Param("customerId")String customerId);
}
